SOCKETS.OPEN Function

The SOCKETS object is deprecated and may be removed in a future release. Use INET::Socket instead.

Syntax

as P = Open(C Host,N tcp_port[,C mode, [N ConnectTimeout]])

Arguments

P

A pointer to the open connection.

Host

The hostname or IP address of the remote host to connect to, such as "www.alphasoftware.com".

tcp_port

The TCP/IP port to open the connection on.

mode

The socket mode:"C" = Client, "S" = Server, "L" = Listener

ConnectTimeout

Optional. The time-out period in milliseconds.

Description

Open an existing socket - mode is S for server, C for client, L for Listen (server without accept), R for server with reuse address flag.

Discussion

The SOCKETS.OPEN() method establishes an Internet connection. The method creates a blocking call, which means that the system will be unresponsive until either the socket is successfully opened or ConnectTimeout milliseconds have elapsed. "C" and "S" mode socket open calls are blocking. This means that a client or server socket open call will not return until the connection is successfully established or the connection attempt is aborted by the operating system. This can cause Alpha Anywhere to appear to be hung while a connection is being established, as the operating system timeout period is typically 8 minutes. ConnectTimeout, if specified, is the time in milliseconds to wait before aborting the connection attempt and allows the operating system timeout to be overridden.

See Also